package com.fbms.common.result;

import lombok.Getter;

import java.util.Collection;


/**
 * @author lan
 * @since 2023/03/15  10:21
 * 集合类型的结果集
 */
@Getter
public class MultiResponse<T> {

    /**
     * 构造方法（通过builder构建 ）
     *
     * @param builder 构建器
     */
    protected MultiResponse(MultiResBuilder<T> builder) {
        this.data = builder.getData();
        this.msg = builder.getMsg();
        this.status = builder.getStatus();
        this.flag = builder.getFlag();
        this.code = builder.getCode();
    }

    /**
     * 返回前台数据
     */
    private final Collection<T> data;


    /**
     * 返回前台成功失败标志
     */
    private final String flag;

    /**
     * 返回消息
     */
    private final String msg;


    /**
     * 返回状态码
     */
    private final Integer code;


    /**
     * 返回状态位
     */
    private final String status;


}
